<?php
    if(1==2){$HttpResult = new HttpResult();}
    $HttpContentResult = $HttpResult->getHttpContentResult();

$head = new HtmlHeader($HttpContentResult->getHeader());    
$head->addCSS('style', 'css/');
$head->addCSS('layout', 'css/');


//<!-- SWF OBJECT -->
$head->addJS('swfobject', 'js/swfobject/');

// JS
$head->addJS('jquery-1.3.2.min', 'js/');
$head->addJS('cufon-yui', 'js/');
$head->addJS('cufon-replace', 'js/');
$head->addJS('Swis721_BT_400.font', 'js/');
$head->addJS('ie_png', 'js/');

$head->show();

?>

<!--[if lte IE 7]>
    <script type="text/javascript" src="js/ie_png.js"></script>
       <script type="text/javascript">
           DD_belatedPNG.fix('.links');
       </script>
<![endif]-->
<body id="page1">
	<!--header -->
	<?php 
	include Config::getFolderView("parts/header.php");
	?>
	<!--header end-->
	<div id="content">
		<div class="main">
			<div class="indent">
				<div class="container">
					<div class="col-1 col-pad">
						<div class="box margin">
							<div class="indent2">
								
								<h3><span><span><strong><strong><?php echo Translation::text("Categoria de Jogos"); ?></strong></strong></span></span></h3>
								
								<?php 
								foreach($HttpContentResult->categorias as $category){
									?>
									<div class="container border-bg">
										<h4><strong><?php echo $category->name;?></strong></h4>
										<a href="<?php echo Config::getRootPath("estilos/estilo/id.".$category->id."/jogos_estilo/".DataHandler::strToURL($category->name)); ?>" class="link"><span><span>Ver jogos desse estilo</span></span></a>
									<?php
									foreach($category->jogos as $jogo){
										?>
										<img src="<?php echo $jogo->img_url; ?>" alt="jogo on line <?php echo $jogo->name;?>" class="imgindent" />
										<?php
									}
								//?>
									</div>
								<?php } ?>
							</div>
						</div>
					</div>
					<div class="col-2">
						<div class="box">
							<div class="indent2">
								<h3><span><span class="h-pad"><?php echo Translation::text("Sorteados"); ?></span></span></h3>
								<?php 
								//Debug::print_r($HttpContentResult->array_random);
								for($i = 6; $i < 10; $i++){
									$jogo = $HttpContentResult->array_random[$i];
									
								//?>
								<div class="container border-bg margin1">
									<div class="col-indent">
										<div class="col-3">
											<h5><?php echo $jogo->name;?></h5>
											<?php //descri��o??? ?><br />
											<a href="<?php echo Config::getRootPath("jogo/id.".$jogo->id."/jogo_gratis/online/".DataHandler::strToURL($jogo->name)); ?>" class="link1">Jogar Agora</a>
											<?php if(UserClient::getTypeId() == Config::ADMIN_USER_TYPE_ID){?>
												<a href="<?php echo Config::getRootPath("admin/jogo/delete/id.".$jogo->id); ?>" class="link1"><span><span>Apagar</span></span></a>
											<?php } ?>
										</div>
										<img src="<?php echo $jogo->img_url; ?>" alt="jogo on line <?php echo $jogo->name;?>"  />
									</div>
								</div>
								<?php
								} 
								?>
							</div>
						</div>
						<?php
						include Config::getFolderView("parts/links.php");
						?>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--footer -->
	<?php
	include Config::getFolderView("parts/footer.php");
	?>
	
	<!--footer end-->
   <script type="text/javascript"> Cufon.now(); </script>
</body>

</html>